package peer.rudp;

public class TaskIdent {
	public int sequence=0;
	public ConnectionUDP conn;
	long hashCode;
	public TaskIdent(ConnectionUDP conn,int sequence){
		this.sequence=sequence;
		this.conn=conn;
		hashCode=(Long.toString(this.conn.connetionId)+Long.toString(this.sequence)).hashCode();
	}
	
	public boolean equals(Object obj){
		TaskIdent ti=(TaskIdent)obj;
		if(ti==null){
			return true;
		}else{
			return sequence==ti.sequence&this.conn.getConnectionId()==ti.conn.getConnectionId();
		}
	}
	
	public int hashCode(){
		return (int) hashCode;
	}
}
